package com.stein.mentalarithmetic;

import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;

public class Test234Add334_2 extends Test234Add334 {

	public Test234Add334_2(Skin skin) {
		super(skin);
	}
	int y1;
	@Override
	protected void nextTest() {
		x = MathUtils.random(100, 999);
		  y1 =  MathUtils.random(1, 9);
		y =  MathUtils.random(51, 99)+y1*100;
		String question = String.format(quesion, new Object[]{x,y});
		questionLabel.setText(question);
		re =   "   "+x+"\n"
				+ "+ "+y+"\n"
				+ "--------";
		resultLabel.setText(re);
	}
	@Override
	protected void showResult() {
		//re+"\n()" 
		int t1 = (y1+1)*100;
		int y2 = t1-y;
		int t2 = y2/10%10*10;
		int t3 = y2%10;
		result_q = String.format(re+"\n(%d+%d-%d-%d)\n=%d", new Object[]{x,t1,t2,t3,(x+y)});
		resultLabel.setText(result_q);
	}
	@Override
	protected void setName() {
		this.name = Test234Add334_2.class.getSimpleName();
	}
}
